package StudyCode.summary.mycollection;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CalculatesThePowerInASampleAsSumOfTheSquaresOfTheAbsoluteValuesOfAllSamples {
	public static double getPower(double[] sample) {
		double power = 0;
		for (int i = 0; i < sample.length; i++) {
			power += Math.pow(Math.abs(sample[i]), 2);
		}
		return power;
	}
}
